'use strict'

import HybridJS from '../core/core'

const $ = HybridJS

export default {
    getClipboardData() {
        return $.callNativeSync("device","getClipboardData")
    },
    setClipboardData(data) {
        return $.callNativeSync("device","setClipboardData",{"data":data})
    },
    /**
     * 获取设备当前电池状态,返回数据：{level:0~100,inCharging:true}
     */
    getBatteryInfo() {
        return $.callNativeSync("device","getBatteryInfo")
    },
    /**
     * 获取当前网络类型，返回数据 ：wifi	wifi网络 ；cellular 蜂窝网络；unknown	 Android 下不常见的网络类型；none	无网络
     */
    getNetworkType() {
        return $.callNativeSync("device","getNetworkType")
    },
    /**
     * 监听网络状态变化事件，参数，function(isConnect:true/false,type:wifi/2g/3g/4g){}
     */
    onNetworkStatusChange(callback) {
        return $.onListenEvent("onNetworkStatusChange", callback)
    }
}